﻿Imports System.Data.OracleClient

Public Class OraDao
    'クエリ実行
    Public Shared Function execQuery(ByVal sql As String) As DataTable
        Dim conn = New OracleConnection(My.Settings.ConnectionString)
        Dim result = New DataTable
        Try
            conn.Open()
            Dim cmd As OracleCommand = New OracleCommand(sql, conn)
            Dim oda = New OracleDataAdapter(cmd)
            oda.Fill(result)
            conn.Close()
        Catch ex As Exception
            Debug.Write(ex.ToString)
        End Try
        Return result
    End Function
    Public Shared Function execNoneQuery(ByVal Sql As String) As Integer
        Dim conn As OracleConnection = New OracleConnection(My.Settings.ConnectionString)
        Dim ret As New Integer
        Try
            conn.Open()
            Dim cmd As OracleCommand = New OracleCommand(Sql, conn)
            ret = cmd.ExecuteNonQuery
            conn.Close()
        Catch ex As Exception
            Debug.Write(ex.ToString)
        End Try
        Return ret
    End Function
End Class
